package com.edu.exam.enums.academic;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 学术层次枚举
 */
@Getter
@AllArgsConstructor
public enum AcademicLevelType {
    UNDERGRADUATE("UNDERGRADUATE", "本科"),
    GRADUATE("GRADUATE", "研究生"),
    DOCTORAL("DOCTORAL", "博士"),
    PROFESSIONAL("PROFESSIONAL", "职业");

    private final String code;
    private final String description;

    public static AcademicLevelType fromCode(String code) {
        for (AcademicLevelType level : values()) {
            if (level.getCode().equals(code)) {
                return level;
            }
        }
        return UNDERGRADUATE; // 默认返回本科
    }
}